#include "Bird.h"
#include "Dot.h"

Bird :: Bird(Dot* dot)
{
	this->dot = dot;
}

void Bird :: process(Uint8* keys)
{
	mapX = dot->getY() / SIZEY;
	mapY = dot->getX() / SIZEX;
	if(Manager :: map[mapX][mapY] == -1)
	{
		if(keys[SDLK_0])
			Manager :: map[mapX][mapY] = 0;
		else if(keys[SDLK_1])
			Manager :: map[mapX][mapY] = 1;
		else if(keys[SDLK_2])
			Manager :: map[mapX][mapY] = 2;
		else if(keys[SDLK_3])
			Manager :: map[mapX][mapY] = 3;
		else if(keys[SDLK_4])
			Manager :: map[mapX][mapY] = 4;
		else if(keys[SDLK_5])
			Manager :: map[mapX][mapY] = 5;
	}
}

void Bird :: undo()
{
	Manager :: map[mapX][mapY] = -1;
}